package com.lancoo.cvas.pojo.response.basicPlatform;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lancoo.cvas.entity.Segment;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName BaseLink
 * @Description 环节库
 * @Author quin
 * @Date 2023/4/17 10:47
 */
@NoArgsConstructor
@Data
public class BaseLink {
    @JsonProperty("Term")
    private String term;
    @JsonProperty("LinkID")
    private String linkID;
    @JsonProperty("LinkName")
    private String linkName;
    @JsonProperty("LinkCode")
    private String linkCode;
    @JsonProperty("Credit")
    private Double credit;
    @JsonProperty("WeekCount")
    private Integer weekCount;
    @JsonProperty("KindID")
    private String kindID;
    @JsonProperty("KindName")
    private String kindName;

    @JsonProperty("EnglishName")
    private String englishName;

    public Segment toSegment(Integer taskId) {
        return new Segment()
                .setTaskId(taskId)
                .setBaseSegmentId(linkID)
                .setSegmentName(linkName)
                .setSegmentCode(linkCode)
                .setSegmentTypeId(kindID)
                .setSegmentType(kindName)
                .setCredit(credit)
                .setWeekNum(weekCount)
                .setIsEnable(0);
    }
}
